import hilog from '@ohos.hilog';

class LogUtil {
  private domain: number;

  // format Indicates the log format string.
  private format: string = '%{public}s';

  constructor(domain: number = 0xFF00) {
    this.domain = domain;
  }

  d(tag:string = '',...args: any[]): void {
    hilog.debug(this.domain, tag, this.format, args);
  }

  i(tag:string = '',...args: any[]): void {
    hilog.info(this.domain, tag, this.format, args);
    // console.info()
  }

  w(tag:string = '',...args: any[]): void {
    hilog.warn(this.domain, tag, this.format, args);
  }

  e(tag:string = '',...args: any[]): void {
    hilog.error(this.domain, tag, this.format, args);
  }
}

const logUtil = new LogUtil()
export default logUtil